package me.zhengjie.modules.poker;

public enum Suit {
    HEARTS, DIAMONDS, CLUBS, SPADES;

    public static Suit fromString(String suitStr) {
        switch (suitStr.toLowerCase()) {
            case "梅花": return CLUBS;
            case "红心": return HEARTS;
            case "黑桃": return SPADES;
            case "方片": return DIAMONDS;
            default: throw new IllegalArgumentException("无效的花色: " + suitStr);
        }
    }

    @Override
    public String toString() {
        switch (this) {
            case HEARTS: return "红心";
            case DIAMONDS: return "方片";
            case CLUBS: return "梅花";
            case SPADES: return "黑桃";
            default: return "";
        }
    }
}